package com.car.dal.dao.from;

import java.util.List;

import com.car.bean.GridObj;
import com.car.bean.OrderObj;
import com.car.bean.PageObj;
import com.car.dal.dao.ibatis.IbatisCommonDao;
import com.car.dal.object.JsFromUser;
import com.car.util.Page;

public class FromUserDaoImpl extends IbatisCommonDao<JsFromUser, Long> implements FromUserDao {

    public GridObj GetList(JsFromUser fromUser, PageObj pageObj) {
        OrderObj order = new OrderObj();
        order.setDir("desc");
        order.setSort("id");
        // TODO Auto-generated method stub
        return super.findByPage(fromUser, pageObj, order);
    }

    public Integer getFromUserCountByType(JsFromUser fromUser) {
        return this.queryForInteger("getFromUserCountByType", fromUser);
    }

    public List<JsFromUser> getFromUserByType(JsFromUser fromUser, Page page) {
        fromUser.setFirstrownum(page.getFirstrownum());
        fromUser.setPagesize(page.getPagesize());
        List<JsFromUser> list = this.queryForEntityList(JsFromUser.class, "getFromUserByType", fromUser);
        return list;
    }

    public List<JsFromUser> getFromUserStaticByType(JsFromUser fromUser) {
        List<JsFromUser> list = this.queryForEntityList(JsFromUser.class, "getFromUserStaticByType", fromUser);
        return list;
    }

    @Override
    public Integer getFromUserStaticByType2(JsFromUser fromUser) {
        return this.queryForInteger("getFromUserStaticByType2", fromUser);
    }

    @Override
    public List<JsFromUser> getTypes() {
        List<JsFromUser> list = this.queryForEntityList(JsFromUser.class, "getTypes", null);
        return list;
    }

	@Override
	public List<JsFromUser> getFromUserByXz(JsFromUser fromUser) {
		List<JsFromUser> list = this.queryForEntityList(JsFromUser.class, "getFromUserByXz", fromUser);
        return list;
	}

}
